<template>
    <div class="dates">
        <div class="week">
            <ul v-for="(item,index) in week" :key="index">
                <span>{{item}}</span>
                <li>aa</li>
                <li>aa</li>
                <li>aa</li>
            </ul>
        </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
      week: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
    };
  },
  mounted() {
    this.weeks();
  },
  methods: {
    weeks() {
        function formatTime(date) {
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        //   month = month < 10 ? "0" + month : month;
        var day = date.getDate();
        //   day = day < 10 ? "0" + day : day;
        return year + "," + month + "," + day;
      }
    
      let weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; 
     
      var now = new Date();
      let dates = formatTime(now)
      console.log(dates)

 var day = new Date(2016, 2, 0);
      var daycount = day.getDate();
    //   alert(daycount); //29

        var myDate = new Date(Date.parse(dates));  
        console.log(weekDay[myDate.getDay()]);    // 星期六
    }
  }
};
</script>
<style scoped>
.dates {
  width: 98vw;
  min-height: 100px;
  border: 1px solid orange;
  display: flex;
}
.week {
  width: 98vw;
  min-height: 100px;
  display: flex;
  justify-content: space-around;
}
</style>
